import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/text_title_entity.dart';
import 'package:cbec_app/entity/home/content/content_data.dart';

TextTitleEntity $TextTitleEntityFromJson(Map<String, dynamic> json) {
  final TextTitleEntity textTitleEntity = TextTitleEntity();
  final String? titleSize = jsonConvert.convert<String>(json['title_size']);
  if (titleSize != null) {
    textTitleEntity.titleSize = titleSize;
  }
  final String? descWeight = jsonConvert.convert<String>(json['desc_weight']);
  if (descWeight != null) {
    textTitleEntity.descWeight = descWeight;
  }
  final String? link = jsonConvert.convert<String>(json['link']);
  if (link != null) {
    textTitleEntity.link = link;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    textTitleEntity.title = title;
  }
  final String? align = jsonConvert.convert<String>(json['align']);
  if (align != null) {
    textTitleEntity.align = align;
  }
  final String? uuid = jsonConvert.convert<String>(json['uuid']);
  if (uuid != null) {
    textTitleEntity.uuid = uuid;
  }
  final int? linkId = jsonConvert.convert<int>(json['link_id']);
  if (linkId != null) {
    textTitleEntity.linkId = linkId;
  }
  final String? wxAuthor = jsonConvert.convert<String>(json['wx_author']);
  if (wxAuthor != null) {
    textTitleEntity.wxAuthor = wxAuthor;
  }
  final String? linkMethod = jsonConvert.convert<String>(json['link_method']);
  if (linkMethod != null) {
    textTitleEntity.linkMethod = linkMethod;
  }
  final String? descColor = jsonConvert.convert<String>(json['desc_color']);
  if (descColor != null) {
    textTitleEntity.descColor = descColor;
  }
  final String? templateType = jsonConvert.convert<String>(json['template_type']);
  if (templateType != null) {
    textTitleEntity.templateType = templateType;
  }
  final String? linkStyle = jsonConvert.convert<String>(json['link_style']);
  if (linkStyle != null) {
    textTitleEntity.linkStyle = linkStyle;
  }
  final String? titleColor = jsonConvert.convert<String>(json['title_color']);
  if (titleColor != null) {
    textTitleEntity.titleColor = titleColor;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    textTitleEntity.linkTitle = linkTitle;
  }
  final String? showDivider = jsonConvert.convert<String>(json['show_divider']);
  if (showDivider != null) {
    textTitleEntity.showDivider = showDivider;
  }
  final String? descSize = jsonConvert.convert<String>(json['desc_size']);
  if (descSize != null) {
    textTitleEntity.descSize = descSize;
  }
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    textTitleEntity.linkType = linkType;
  }
  final String? bgColor = jsonConvert.convert<String>(json['bg_color']);
  if (bgColor != null) {
    textTitleEntity.bgColor = bgColor;
  }
  final int? pageMargin = jsonConvert.convert<int>(json['pageMargin']);
  if (pageMargin != null) {
    textTitleEntity.pageMargin = pageMargin;
  }
  final String? wxLinkTitle = jsonConvert.convert<String>(json['wx_link_title']);
  if (wxLinkTitle != null) {
    textTitleEntity.wxLinkTitle = wxLinkTitle;
  }
  final String? titleWeight = jsonConvert.convert<String>(json['title_weight']);
  if (titleWeight != null) {
    textTitleEntity.titleWeight = titleWeight;
  }
  final String? isLink = jsonConvert.convert<String>(json['is_link']);
  if (isLink != null) {
    textTitleEntity.isLink = isLink;
  }
  final String? wxDate = jsonConvert.convert<String>(json['wx_date']);
  if (wxDate != null) {
    textTitleEntity.wxDate = wxDate;
  }
  final String? linkText = jsonConvert.convert<String>(json['link_text']);
  if (linkText != null) {
    textTitleEntity.linkText = linkText;
  }
  final String? desc = jsonConvert.convert<String>(json['desc']);
  if (desc != null) {
    textTitleEntity.desc = desc;
  }
  return textTitleEntity;
}

Map<String, dynamic> $TextTitleEntityToJson(TextTitleEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['title_size'] = entity.titleSize;
  data['desc_weight'] = entity.descWeight;
  data['link'] = entity.link;
  data['title'] = entity.title;
  data['align'] = entity.align;
  data['uuid'] = entity.uuid;
  data['link_id'] = entity.linkId;
  data['wx_author'] = entity.wxAuthor;
  data['link_method'] = entity.linkMethod;
  data['desc_color'] = entity.descColor;
  data['template_type'] = entity.templateType;
  data['link_style'] = entity.linkStyle;
  data['title_color'] = entity.titleColor;
  data['link_title'] = entity.linkTitle;
  data['show_divider'] = entity.showDivider;
  data['desc_size'] = entity.descSize;
  data['link_type'] = entity.linkType;
  data['bg_color'] = entity.bgColor;
  data['pageMargin'] = entity.pageMargin;
  data['wx_link_title'] = entity.wxLinkTitle;
  data['title_weight'] = entity.titleWeight;
  data['is_link'] = entity.isLink;
  data['wx_date'] = entity.wxDate;
  data['link_text'] = entity.linkText;
  data['desc'] = entity.desc;
  return data;
}

extension TextTitleEntityExtension on TextTitleEntity {
  TextTitleEntity copyWith({
    String? titleSize,
    String? descWeight,
    String? link,
    String? title,
    String? align,
    String? uuid,
    int? linkId,
    String? wxAuthor,
    String? linkMethod,
    String? descColor,
    String? templateType,
    String? linkStyle,
    String? titleColor,
    String? linkTitle,
    String? showDivider,
    String? descSize,
    String? linkType,
    String? bgColor,
    int? pageMargin,
    String? wxLinkTitle,
    String? titleWeight,
    String? isLink,
    String? wxDate,
    String? linkText,
    String? desc,
  }) {
    return TextTitleEntity()
      ..titleSize = titleSize ?? this.titleSize
      ..descWeight = descWeight ?? this.descWeight
      ..link = link ?? this.link
      ..title = title ?? this.title
      ..align = align ?? this.align
      ..uuid = uuid ?? this.uuid
      ..linkId = linkId ?? this.linkId
      ..wxAuthor = wxAuthor ?? this.wxAuthor
      ..linkMethod = linkMethod ?? this.linkMethod
      ..descColor = descColor ?? this.descColor
      ..templateType = templateType ?? this.templateType
      ..linkStyle = linkStyle ?? this.linkStyle
      ..titleColor = titleColor ?? this.titleColor
      ..linkTitle = linkTitle ?? this.linkTitle
      ..showDivider = showDivider ?? this.showDivider
      ..descSize = descSize ?? this.descSize
      ..linkType = linkType ?? this.linkType
      ..bgColor = bgColor ?? this.bgColor
      ..pageMargin = pageMargin ?? this.pageMargin
      ..wxLinkTitle = wxLinkTitle ?? this.wxLinkTitle
      ..titleWeight = titleWeight ?? this.titleWeight
      ..isLink = isLink ?? this.isLink
      ..wxDate = wxDate ?? this.wxDate
      ..linkText = linkText ?? this.linkText
      ..desc = desc ?? this.desc;
  }
}
